<?php
namespace App\Goods\Services;

use App\BaseService;
use App\Goods\Models\CommonName;
use App\Goods\Models\GoodsAttr;
use App\Exceptions\GoodsException;
use Exception;

class GoodsAttrService extends BaseService
{

    /**
     *
     * @param $params
     * @return mixed
     * @throws \Exception
     */
    public function attrList()
    {

        try {
            $data= GoodsAttr::select(['id', 'sort', 'name', 'pid', 'type'])->orderBy('sort', 'asc')->get();
        } catch (\Exception $exception) {
            return $this->error($exception->getMessage());
        }

        return $this->success('登录成功', $data);
    }


}
